'use strict';

/**
 * @param { Egg.EggAppInfo } appInfo app info
 */
module.exports = appInfo => {
  /**
   * @type { Egg.EggAppConfig }
   **/
  const config = (exports = {});
  config.keys = appInfo.name + '_1603798073155_8303';
  config.middleware = [];
  const userConfig = {};

  // 禁用csrf防御
  config.security = {
    csrf: {
      enable: false,
    },
  };

  // 配置nunjucks
  config.view = {
    defaultExtension: 'html',
    defaultViewEngine: 'nunjucks',
  };

  // 设置静态文件目录
  config.static = {
    prefix: '/',
    dir: appInfo.baseDir + '/app/public',
  };

  return {
    ...config,
    ...userConfig,
  };
};
